package cn.batch.daemon.service.impl;

import java.util.Date;
import java.util.List;

import cn.batch.daemon.bean.ApplicantionInfo;
import cn.batch.daemon.hibernate.bean.BatchRiskData;
import cn.batch.daemon.hibernate.bean.PbocSummary;
import cn.batch.daemon.hibernate.dao.ApplicationInfoDao;
import cn.batch.daemon.hibernate.dao.BatchRiskDataDao;
import cn.batch.daemon.hibernate.dao.PbocSummaryDao;
import cn.batch.daemon.service.RiskWarningService;

public class RiskWarningServiceImpl implements RiskWarningService {

	private PbocSummaryDao pbocSummaryDao;
	private ApplicationInfoDao applicantionInfoDao;
	private BatchRiskDataDao batchRiskDataDao;
	
	@Override
	public List<PbocSummary> queryByExample(PbocSummary bo) {
		return pbocSummaryDao.queryByExample(bo);
	}
	
	@Override
	public List<ApplicantionInfo> queryApplicantionInfo(ApplicantionInfo ai) {
		return applicantionInfoDao.queryByExample(ai);
	}

	@Override
	public void save(ApplicantionInfo app) {
		applicantionInfoDao.save(app);
	}
	@Override
	public void saveAll(List<ApplicantionInfo> appInfoCache) {
		applicantionInfoDao.saveAll(appInfoCache);
	}

	@Override
	public void deleteApplicantionInfo(ApplicantionInfo ai) {
		applicantionInfoDao.delete(ai);
	}
	@Override
	public void deleteApplicantionInfo(List<ApplicantionInfo> entities) {
		applicantionInfoDao.deleteAll(entities);
	}
	
	@Override
	public void deleteAppInfoByBatchNoAndType(String batchDate, String value) {
		applicantionInfoDao.deleteAppInfoByBatchNoAndType(batchDate, value);
		
	}

	@Override
	public void saveBatchRiskData(BatchRiskData batchRiskData) {
		batchRiskDataDao.save(batchRiskData);
	}

	@Override
	public List<BatchRiskData> queryBatchRiskData(BatchRiskData batchRiskData) {
		return batchRiskDataDao.queryByExample(batchRiskData);
	}

	@Override
	public void deleteBatchRiskData(BatchRiskData batchRiskData) {
		batchRiskDataDao.delete(batchRiskData);
	}
	@Override
	public void updateBatchRiskData(BatchRiskData batchRiskData) {
		batchRiskDataDao.getHibernateTemplate().update(batchRiskData);
	}
	
	@Override
	public Date queryBybatchRiskData(PbocSummary bo) {
		return pbocSummaryDao.queryBybatchRiskData(bo);
	}
	
	public PbocSummaryDao getPbocSummaryDao() {
		return pbocSummaryDao;
	}

	public void setPbocSummaryDao(PbocSummaryDao pbocSummaryDao) {
		this.pbocSummaryDao = pbocSummaryDao;
	}

	public ApplicationInfoDao getApplicantionInfoDao() {
		return applicantionInfoDao;
	}

	public void setApplicantionInfoDao(ApplicationInfoDao applicantionInfoDao) {
		this.applicantionInfoDao = applicantionInfoDao;
	}
	/**
	 * @return the batchRiskDataDao
	 */
	public BatchRiskDataDao getBatchRiskDataDao() {
		return batchRiskDataDao;
	}

	/**
	 * @param batchRiskDataDao the batchRiskDataDao to set
	 */
	public void setBatchRiskDataDao(BatchRiskDataDao batchRiskDataDao) {
		this.batchRiskDataDao = batchRiskDataDao;
	}

	@Override
	public void deleteBatchRiskDataByBachNo(String date) {
		pbocSummaryDao.deleteBatchRiskDataByBachNo(date);
		
	}

	

	
	
}
